<?php
/**
 * Created by PhpStorm.
 * User: lidan
 * Date: 2018/8/29
 * Time: 上午9:46
 */
namespace index\models;

use Illuminate\Database\Eloquent\Model as Eloquent;
class Users extends Eloquent
{
    protected $table = 'users';
    protected $primaryKey = '=id';

    /*
     * 根据昵称查询用户列表
     */
    public function getUserListByNickname($nickname) {
        return self::where(['name'=>'wansan'])
            ->orderBy('id', 'desc')
//            ->offset(1)
//            ->take(2)
            ->get()
            ->toArray();
    }


}